<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <title>添加信息</title>
  <div th:replace="common/link::header"></div>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">基本信息</div>
        <div class="layui-card-body">
            <div class="layui-row">
                <div class="layui-form layui-form-pane" lay-filter="ad_form" id="ad_form">
                    <input type="hidden" name="id" id="id">
                    <div class="layui-form-item">
               <!--         <label class="layui-form-label">图片</label>
                        <div style="width: 1000px">
                            <div class="layui-upload">
                                <input type="hidden" id="picture" name="picture">
                                <div class="layui-upload-list" id="img_upload">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img0"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img1"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img2"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img3"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img4"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img5"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img6"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img7"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img8"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img9"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img10"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img11"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img12"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img13"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img14"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img15"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img16"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img17"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img18"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img19"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img20"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img21"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img22"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img23"
                                         hidden="true">
                                    <img style="width: 100px;height: 100px;padding: 5px;float: left;"
                                         onclick="fun.preview(this)" id="upload-img24"
                                         hidden="true">
                                    <p id="upload-img-text"></p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" style="text-align: center">
                        <div class="layui-btn-group">
                            <button type="button" class="layui-btn layui-btn-primary" id="upload-img-btn">上传
                            </button>
                            <button type="button" class="layui-btn layui-btn-primary" id="clear-img-btn">清除
                            </button>
                        </div>
                    </div>-->
                    <!--第一个-->
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">线路编号</label>
                        <div class="layui-input-inline">
                            <input type="text" lay-verify="required" class="layui-input" name="lineNo"
                                   placeholder="请输入线路编号"/>
                        </div>
                    </div>
                    <!--第二个-->
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">线路名称</label>
                        <div class="layui-input-inline">
                            <input type="text" lay-verify="required" class="layui-input" name="lineName"
                                   placeholder="请输入线路名称"/>
                        </div>
                    </div>
                    <!--第三个-->
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">站点名称</label>
                        <div class="layui-input-inline">
                            <input type="text" lay-verify="required" class="layui-input" name="stationName"
                                   placeholder="请输入站点名称"/>
                        </div>
                    </div>
                    <!--第四个-->
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">位置</label>
                        <div class="layui-input-inline">
                            <input type="text" lay-verify="required" class="layui-input" name="location"
                                   placeholder="请输入位置"/>
                        </div>
                    </div>
                    <!--第七个-->
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">大机型</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type"
                                   placeholder="请输入大机型"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型1</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type1"
                                   placeholder="请输入机型1"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码1</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type1Code"
                                   placeholder="请输入机型代码1"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">通道类型1</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="pass1"
                                   placeholder="请输入通道类型1"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型2</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type2"
                                   placeholder="请输入机型2"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码2</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type2Code"
                                   placeholder="请输入机型代码2"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">通道类型2</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="pass2"
                                   placeholder="请输入通道类型2"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型3</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type3"
                                   placeholder="请输入机型3"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码3</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type3Code"
                                   placeholder="请输入机型代码3"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">通道类型3</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="pass3"
                                   placeholder="请输入通道类型3"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型4</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type4"
                                   placeholder="请输入机型4"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码4</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type4Code"
                                   placeholder="请输入机型代码4"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">通道类型4</label>
                        <div class="layui-input-inline">
                            <input type="text"  class="layui-input" name="pass4"
                                   placeholder="请输入通道类型4"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型5</label>
                        <div class="layui-input-inline">
                            <input type="text"  class="layui-input" name="type5"
                                   placeholder="请输入机型5"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码5</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="type5Code"
                                   placeholder="请输入机型代码5"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">通道类型5</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="pass5"
                                   placeholder="请输入通道类型5"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型6</label>
                        <div class="layui-input-inline">
                            <input type="text"  class="layui-input" name="type6"
                                   placeholder="请输入机型6"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码6</label>
                        <div class="layui-input-inline">
                            <input type="text"  class="layui-input" name="type6Code"
                                   placeholder="请输入机型代码6"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">通道类型6</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="pass6"
                                   placeholder="请输入通道类型6"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型7</label>
                        <div class="layui-input-inline">
                            <input type="text"  class="layui-input" name="type7"
                                   placeholder="请输入机型7"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 180px">机型代码7</label>
                        <div class="layui-input-inline">
                            <input type="text"  class="layui-input" name="type7Code"
                                   placeholder="请输入机型代码7"/>
                        </div>
                    </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">通道类型7</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="pass7"
                                       placeholder="请输入通道类型7"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">机型8</label>
                            <div class="layui-input-inline">
                                <input type="text"  class="layui-input" name="type8"
                                       placeholder="请输入机型8"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">机型代码8</label>
                            <div class="layui-input-inline">
                                <input type="text"  class="layui-input" name="type8Code"
                                       placeholder="请输入机型代码8"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">通道类型8</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="pass8"
                                       placeholder="请输入通道类型8"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">机型9</label>
                            <div class="layui-input-inline">
                                <input type="text"  class="layui-input" name="type9"
                                       placeholder="请输入机型9"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">机型代码9</label>
                            <div class="layui-input-inline">
                                <input type="text"  class="layui-input" name="type9Code"
                                       placeholder="请输入机型代码9"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">通道类型9</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="pass9"
                                       placeholder="请输入通道类型9"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">机型10</label>
                            <div class="layui-input-inline">
                                <input type="text"  class="layui-input" name="type10"
                                       placeholder="请输入机型10"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 180px">机型代码10</label>
                            <div class="layui-input-inline">
                                <input type="text"  class="layui-input" name="type10Code"
                                       placeholder="请输入机型代码10"/>
                            </div>
                        </div>
                    <div class="layui-form-item layui-hide">
                        <input type="button" lay-submit lay-filter="save-submit" id="save-submit" value="确认">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:replace="common/script::footer"></div>
<script th:inline="javascript">
  layui.config({
      base: '/static/layuiadmin/' //静态资源所在路径
  }).extend({
     index: 'lib/index', //主入口模块
  }).use(['index', 'form','crud','upload'], function(){
    let $ = layui.$,
            form = layui.form,
            crud = layui.crud,
            upload = layui.upload;
    // 编辑器
    //crud.initEditor('adContent');
    form.on('submit(save-submit)', function(data) {
        $.ajax({
        type: 'POST',
        url:  ctx + '/app/user/add',
        data: JSON.stringify(data.field),
        contentType:'application/json;charset=UTF-8',
        dataType: 'json',
        success: function(result) {
          layer.msg(result.message);
          if (result.code === 200) {
            let index = parent.layer.getFrameIndex(window.name);
            // 关闭
            parent.layer.close(index);
            // 刷新
            parent.location.reload();
          }
        }
      });
    });
    //普通图片上传
    crud.uploadImg("picture");
  });
</script>
</body>
</html>